// 登录日志
<template>
  <div
    class="page-container page-container-havePagination"
    :class="{'page-container-haveFooter':$store.state.settings.showFooter}"
  >
    <!-- 工具栏 -->
    <div class="head-search-container"></div>
    <!-- 表格渲染 -->
    <el-table
      header-row-class-name="table-header-style"
      :row-class-name="tableRowStyle"
      :data="tableData"
      tooltip-effect="dark"
      style="width: 100%"
      v-loading="loading"
    >
      <el-table-column prop="name" label="登录用户" show-overflow-tooltip></el-table-column>
      <el-table-column prop="loginTime" label="登录时间" show-overflow-tooltip>
        <template slot-scope="scope">
          <span>{{scope.row.loginTime | dealTimeStamp}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="loginResult" label="登录状态" show-overflow-tooltip></el-table-column>
      <el-table-column prop="loginIp" label="ip地址" show-overflow-tooltip></el-table-column>
    </el-table>
    <!-- 分页器 -->
    <TablePagination
      :total="total"
      :currentPage="currentPage"
      :pageSize="pageSize"
      @changeSize="changeSize"
      @changePage="changePage"
      :class="['table-pagination',{'table-pagination-haveFooter':$store.state.settings.showFooter}]"
    />
  </div>
</template>
<script>
import initData from "@/mixins/req";
import store from "@/store";
export default {
  name: "Log",
  mixins: [initData],
  data() {
    return {};
  },
  created() {
    this.init();
  },
  methods: {
    beforeInit() {
      this.url = store.getters["api/logs"];
      this.searchParams = {
        currentPage: this.currentPage,
        pageSize: this.pageSize
      };
      return true;
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/page.scss";
@import "~@/assets/styles/table.scss";
</style>
